package inherit.practice.demo02.ArrayList02;

import java.util.Scanner;

public class CarsTest {
    public static void main(String[] args) {
        Cars[] arr = new Cars[3];
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < arr.length; i++) {
            Cars cars = new Cars();
            System.out.println("请输入汽车品牌");
            cars.setBrand(sc.next());
            System.out.println("请输入汽车价格");
            cars.setPrice(sc.nextInt());
            System.out.println("请输入汽车颜色");
            cars.setColor(sc.next());
            arr[i] = cars;
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i].getBrand()+","+arr[i].getPrice()+","+arr[i].getColor());
        }
    }
}
